﻿using System;
using System.Collections.Generic;
using BusinessLayer;
using System.Diagnostics;

namespace RunListenerServerAndCarEmulators
{
    class Program
    {
        static void Main(string[] args)
        {
            Process process = new Process();
            process.StartInfo.FileName = "C:\\Users\\Robert Sargsyan\\Documents\\Visual Studio 2012\\Projects\\Tracking\\ListenerServer\\bin\\Debug\\ListenerServer.exe";
            process.Start();

            Reader<Car> reader = Car.Repository.ReadAll();
            while(reader.Read())
            {
                process = new Process();
                process.StartInfo.FileName = process.StartInfo.WorkingDirectory + "C:\\Users\\Robert Sargsyan\\Documents\\Visual Studio 2012\\Projects\\Tracking\\CarEmulator\\bin\\Debug\\CarEmulator.exe";
                process.StartInfo.Arguments = reader.Current.Id.ToString() +" 2";
                process.Start();
            }
            reader.Close();
        }
    }
}
